import { createApp } from "vue";
// import App from "./PriceApp.vue";
import App from "./MainApp.vue";
import router from "./router";

/* 引入 ElementPlus */
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import axios from "axios";
import zhCn from "element-plus/es/locale/lang/zh-cn";

const app = createApp(App);
app.use(ElementPlus, { locale: zhCn }).use(router);

// axios.defaults.baseURL = "http://localhost:9021";
// app.config.globalProperties.$baseURL = "http://localhost:9021";
// axios.defaults.baseURL = "http://10.198.1.116:9021";
// app.config.globalProperties.$baseURL = "http://10.198.1.116:9021";
axios.defaults.baseURL = "http://10.198.1.48:9021";
app.config.globalProperties.$baseURL = "http://10.198.1.48:9021";

app.config.globalProperties.$http = axios;

app.use(router).use(ElementPlus).mount("#app");

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
